<?php


include_once dirname(__FILE__) . "/log.php";

$raw_data = file_get_contents("php://input");
if($raw_data)
{
    Log::init("fakeQQ");
    Log::debug("recv request:" . $raw_data);
    
    $file = dirname(__FILE__) .  "/test/.qq.dat";
    $data = unserialize(file_get_contents($file));
    if(!is_array($data))
    {
        $ret = array(
            "code" => -2,
            "msg" => "qq load data errorrrrrrr",
        );
    }
    else
    {
        $args = $raw_data;
        //Log::debug( var_export($data, true));
        if(!array_key_exists($args, $data))
        {
            $ret = array(
                "code" => -3,
                "msg" => "qq not found index errorrrrrrr",
            );
        }
        else
        {
            $ret = $data[$args];
        }
    }
    echo json_encode($ret) . "\n";
}

?>
